<?php 
//include  "./../protected.php"; /*Valida el inico de sesion*/
?>
<!doctype html>
<html lang="es">
<head>
  <meta charset="UTF-8">
  <title>Actualizar académicos </title>
  <link rel="stylesheet" type="text/css" href="mtb.css"/>
  <link rel="stylesheet" type="text/css" href="main.css"/>
  <link rel="stylesheet" type="text/css" href="ceGrid.css"/>
  <link rel="stylesheet" type="text/css" href="../bootstrap.css"/>
  <script type="text/javascript" src="../../../js/jquery.js"></script>
  <link rel="stylesheet" type="text/css" href="../../../css/index.css" />
  
  <script>
    function soloLetras(e){
       key = e.keyCode || e.which;
       tecla = String.fromCharCode(key).toLowerCase();
       letras = " áéíóúabcdefghijklmnñopqrstuvwxyz";
       especiales = "8-37-39-46";

       tecla_especial = false
       for(var i in especiales){
            if(key == especiales[i]){
                tecla_especial = true;
                break;
            }
        }

        if(letras.indexOf(tecla)==-1 && !tecla_especial){
            return false;
        }
    }
</script>
  
  
</head>

<?php
require '../GestionPermisos/config/conn.php';
$id=$_GET['id'];
$SQLstr = "SELECT GA05IDTR,GA05NOTR,GA05A1TR,GA05A2TR FROM ga05tpresp WHERE GA05IDTR = '".$id."'";
$EjecutaCSQL = $conectarBD->query($SQLstr);
while ($registros = $EjecutaCSQL->fetch_row())
{    
   $vIDTR=$registros[0];
   $vNOTR=$registros[1];
   $vA1TR=$registros[2];
   $vA2TR=$registros[3];
}
$conectarBD->close();
?>



<body background="#7FAECC">
<br />
<br />
<br />
    <div id="content-mt">

        
         <!--   <form name="Registroact" method="POST" id="form-pro" action="update.php" class="style" >         
                <table id = "tab01">
                <div id="error"></div>
                   <tr>
                      <td>Código</td>
                      <td><label>
                       <input type="text" name="id" id="id" value="<?php echo $id; ?>" readonly  maxlength="15" /> 
                   </label></td>
               </tr>
               <tr> <td>Nombre</td>
                   <td><label>
                       <input type="text" name="nombre" id="nombre"  value="<?php echo  $vNOTR;?>" maxlength="80" onkeypress="return soloLetras(event)"/> 
                   </label>
               </tr>
               <tr>
                  <td>Apellido 1</td>
                  <td><label>
                   <input type="text" name="apelli1" id="apelli1" value="<?php echo $vA1TR;?>"  maxlength="10" /> 
               </label></td>
           </tr>
           <tr>
                      <td>Apellido 2</td>
                      <td><label>
                       <input type="text" name="apelli2" id="apelli2" value="<?php echo $vA2TR; ?>" maxlength="15" /> 
                   </label></td>
               </tr>
           <tr>
               <td></td>
               <td><label>
                   <input type="submit" name="Agregar_Btn" class="btn-m" id="Agregar_Btn" value="Cambiar" />
               </label></td>
           </tr>

       </table> 
   </form>-->

   <form class="form-horizontal" name="Registroact" method="POST" id="form-pro" action="update.php">
<fieldset>
<!-- Form Name -->
<legend>Actualización del Responsable</legend>

<!-- Text input-->
<div class="form-group">
  <label for="textinput">Identificación</label>  
  <input  type="text" name="id" id="id" value="<?php echo $id; ?>" readonly class="form-control input-md" required>
  </div>


<!-- Text input-->
<div class="form-group">
  <label for="textinput">Nombre</label>  
  <input type="text" name="nombre" id="nombre"  value="<?php echo  $vNOTR;?>" maxlength="20"  class="form-control input-md"onkeypress="return soloLetras(event)" required>
  </div>


<!-- Text input-->
<div class="form-group">
  <label for="textinput">Primer Apellido</label>  
  <input  type="text" name="apelli1" id="apelli1" value="<?php echo $vA1TR;?>"  class="form-control input-md" maxlength="20" onkeypress="return soloLetras(event)" required>
  </div>


<!-- Text input-->
<div class="form-group">
  <label for="textinput">Segundo Apellido</label>  
  <input  type="text" name="apelli2" id="apelli2" value="<?php echo $vA2TR; ?>" class="form-control input-md" maxlength="20" onkeypress="return soloLetras(event)" required> 
  </div>


<!-- Button -->
<div class="form-group">
    <button type="submit" name="Agregar_Btn" class="btn" onclick="pregunta()" id="Agregar_Bt">Actualizar</button>
 <a class="btn" href="index.php">Lista de Responsables</a>
</div>
</div>
</fieldset>
</form>

</div>
</div>
</body>

<script type="text/javascript">
    $(function(){
      $("#Agregar_Btn").click(function(){
        $('this').preventDefault;
         var pk = $('#Txt_GA05IDTR').val();; // El script a dÃ³nde se realizarÃ¡ la peticiÃ³n.
         var nom= $('#Txt_GA05NOTR').val();
         var ape1= $('#Txt_GA05A1TR').val();
         var ape2= $('#Txt_GA05A2TR').val(); 
         var data1="Txt_GA05IDTR="+pk+"&Txt_GA05NOTR="+nom+"&Txt_GA05A1TR="+ape1+"&Txt_GA05A2TR="+ape2;
         $.ajax({
          type: "POST",
          url: "update.php",
                   data: data1, // Adjuntar los campos del formulario enviado.
                   success: function(data)
                   {
                    $("#error").html(data);
                   }
               });
            return false; // Evitar ejecutar el submit del formulario.
        });
      });
    function pregunta(){ 
    if (confirm('¿Estas seguro de enviar este formulario?')){ 
       document.tuformulario.submit() 
    } 
} 
</script>


</html>v>